package testDemo.Thread.ProducerAndCustomer;

import java.util.Random;

public class Customer implements Runnable {
    private Box box;
    private Random random = new Random();

    public Customer(Box box) {
        this.box = box;
    }

    @Override
    public void run() {
        while(true){
            box.get(random.nextInt(1)+1);
            System.out.println("\33[1;97;102m"+"剩余"+box.size()+"瓶牛奶"+"\33[0m");
        }
    }
}
